package com.yb.guigu.pick.security.generator;


import com.yb.guigu.pick.security.bean.GuiguPickUser;

import java.util.List;

public  class GuiguPickDelegateCodeGenerator implements GuiguPickCodeGenerator {
    List<GuiguPickCodeGenerator> guiguPickCodeGenerators;

    public GuiguPickDelegateCodeGenerator(List<GuiguPickCodeGenerator> guiguPickCodeGenerators){
        this.guiguPickCodeGenerators = guiguPickCodeGenerators;
    }

    public boolean support(String loginType){
            return true;
    }
    public String generate(GuiguPickUser guiguPickUser){

        for (GuiguPickCodeGenerator guiguPickCodeGenerator : guiguPickCodeGenerators) {
            if(guiguPickCodeGenerator.support(guiguPickUser.getLoginType())){
                return guiguPickCodeGenerator.generate(guiguPickUser);
            }
        }
        return "";
    }
}
